package com.itheima.service;

import com.itheima.mapper.BrandMapper;
import com.itheima.mapper.impl.BrandMapperImpl;
import com.itheima.pojo.Brand;

import java.util.List;

/**
 * 业务层
 */
public class BrandService {

    private BrandMapper brandMapper = new BrandMapperImpl();

    /**
     * 查询所有的品牌
     */
    public List<Brand> selectAll() {
        return brandMapper.selectAll();
    }

    /**
     * 添加品牌
     */
    public void add(Brand brand) {
        brandMapper.add(brand);
    }

    /**
     * 回显品牌
     */
    public Brand selectById(Integer id) {
        return brandMapper.selectById(id);
    }

    /**
     * 更新
     */
    public void update(Brand brand) {
        brandMapper.update(brand);
    }

    /**
     * 删除
     */
    public void deleteById(Integer id) {
        brandMapper.deleteById(id);
    }
}
